package io.renren.modules.neo4j.respository;

import io.renren.modules.neo4j.entity.RelationShip;
import io.renren.modules.neo4j.entity.base.BaseRelationship;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BaseRelationshipRepository extends Neo4jRepository<BaseRelationship,Long> {

    List<BaseRelationship> findBaseRelationshipsByName(String name);

    @Query("match (n)-[m]->(q) return n")
    List<Object> findPersonRelationshipByName(@Param("name")String name);


}
